package com.design.pattern.singleton;

/**
 * @author 王霄
 * @date 2022/6/16 10:07
 */
public class Connection {

    private Connection() {
    }

    private static Connection singleton;


    public static synchronized Connection getInstance() {
        if (singleton == null) {
            singleton = new Connection();
        }
        return singleton;
    }


    public void exec() {
        System.out.println("执行命令");
    }

}
